package com.ssmTest.service.impl;

import com.ssmTest.dao.IOrderDao;
import com.ssmTest.model.Order;
import com.ssmTest.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("orderService")
public class OrderServiceImpl implements IOrderService {
    @Resource
    private IOrderDao iOrderDao;
    @Autowired
    private IOrderService iOrderService;

    public int insertOrder(Order order) {
        return iOrderDao.insertOrder(order);
    }

    public List<Order> orderList(int toexamine) {
        List<Order> list = iOrderDao.orderList(toexamine);
        return list;
    }

    public List<Order> orderList() {
        List<Order> list = iOrderDao.orderLists();
        return list;
    }

    public Order selectOrderByID(int id) {
        return this.iOrderDao.selectOrderByID(id);
    }

    public List<Order> selectOrderByDate(String startdate, String enddate) {
        List<Order> list = iOrderDao.selectOrderByDate(startdate, enddate);
        return list;
    }

    public int numberOfOrder(String startdate, String enddate) {
        return this.iOrderDao.numberOfOrder(startdate, enddate);
    }

    public List<Order> selectOrders(int second_party,int pagenum) {
        return iOrderDao.selectOrders(second_party,(pagenum - 1) * 10, pagenum * 10);
    }
    public List<Order> selectOrder(int first_party,int pagenum) {
        return iOrderDao.selectOrder(first_party,(pagenum - 1) * 10, pagenum * 10);
    }
    public List<Order> selectByPersionalId(int personal_id){
        return this.iOrderDao.selectByPersionalId(personal_id);
    }


    public void updateOrderToexamine(int id,int toexamine){
        iOrderDao.updateOrderToexamine(id,toexamine);
    }
}
